package io.copyTest;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

//使用字节流复制视频文件
public class CopyTest {

    //入口
    public static void main(String[] args) throws IOException {

        //创建读取字节流对象     复制对象

        FileInputStream fileInputStream = new FileInputStream("G:\\a.avi");

        //创建写入字节流对象     复制到
        FileOutputStream fileOutputStream = new FileOutputStream("E:\\a.avi");

        //读取并写入数据
        byte [] bytes = new byte[1024];
        int len = -1 ;
        while ((len = fileInputStream.read(bytes))!=-1){
            fileOutputStream.write(bytes);
        }

        //回收资源

        fileInputStream.close();
        fileOutputStream.close();







    }
}
